print(11//2)
print(11%2)
print(11**2)
print()

#运算符优先级
print('1.运算符优先级')
print('先计算括号: ()')
print('算术运算符: ** * / % // + -')
print('位运算符: >> << & |')
print('比较运算符: > < >= <= == !=')
print('布尔运算符: and or ')
print('赋值运算符:  =')
print()

#2,赋值运算符
print('2.赋值运算符')
a,b,c = 20,30,40
print(a,b,c)
#解包赋值， 交换值
a,b = 10, 20
print('交换之前:', a,b)
a,b = b,a
print('交换之后:', a, b)
print()

#3.比较运算符
print('3.赋值运算符')
a,b = 10, 20
c = 30
d = 30
print('a>b?', a>b)
print('a<b?', a<b)
print('a<=b?', a<=b)
print('a>=b?', a>=b)
print('a!=b?', a!=b)
print(c==d)
print(c is d) #c和d的id标识一样，所以结果为true
print(id(c))
print(id(d))
print()

#4.布尔运算符
print('4.布尔运算符')
a,b = 1,2
print(a == 1 and b == 2)
print(a == 1 or b == 3)
print(a != 1 and b != 2)
print(not a==1 or b !=2)
w = "hello world!"
print('w' in w)
print('g' in w)
print('g' not in w)
print()

#5.位运算符
print('5.位运算')
print(4 & 8) #二进制进行&运算，结果为0
print(4 | 9) #二进制进行|运算，结果为13
print(2 << 3) #向左移动3位，结果为16
print(2 << 5) #向左移动5位，结果为64
print(16 >> 2) #向右移动2位，相当于除以4
